<?php

/**
 * MVM_MALL 网上商店系统  会员积分管理
 * ============================================================================
 * 版权所有 (C) 2007-2010 www.mvmmall.com，并保留所有权利。
 * 网站地址: http://www.mvmmall.com
 * ----------------------------------------------------------------------------
 * 这是一个免费开源的软件；这意味着您可以在不用于商业目的的前提下对程序代码
 * 进行修改、使用和再发布。
 * ============================================================================
 * $Author:  www.mvmmall.com  $
 * $Date: 2008-02-27 $
 * $Id: member_point.inc.php www.mvmmall.com$
 * ---------------------------------------------
*/

if(!defined('MVMMALL') || !defined('IN_ADMINCP')) exit('Access Denied');
if($action=='list'){
    $scarch_sql="where point_category = '1'";
    if($ps_member){
        $ps_member = dhtmlchars($ps_member);
        $scarch_sql .= " and point_id = '$ps_member' ";
    }
    require_once 'include/pager.class.php';
    $total_count = $db->counter("{$tablepre}point_table",$scarch_sql);
    $page        = $page ? (int)$page:1;
    $list_num = 15;
    $rowset = new Pager($total_count,$list_num,$page);
    $from_record = $rowset->_offset();
    $result = $db->query("SELECT * FROM {$tablepre}point_table $scarch_sql ORDER BY uid DESC LIMIT $from_record,$list_num");
    $member_point = array();
    while($rt = $db->fetch_array($result)) {
    	$rt['register_date'] = date($mm_date_format,$rt['register_date']);
    	$rt['approval']      = $rt['approval_date'] > '10' ? '[审定]' : '[未审定]';
    	$member_point[]= $rt;

    }
    $page_list = $rowset->link("admincp.php?module=member_point&action=list&ps_member=$ps_member&page=", $exc);
    require_once template('member_point');
    footer();
}
